$(function () {
	vm.getMentorList();
});

var vm = new Vue({
	el:'#mapp',
	data:{
		title: "",
		//项目进展
		bsnXmjz: {},
		//导师列表
		bsnMentorList: {},
		pageParams: {
			limit: "500",
			page: "1"
		}
	},
	methods: {
		getMentorList: function(){
			$.ajax({
				type: "POST",
			    url: ajaxServerUrlG("bsnmentor/list"),
                contentType: "application/json",
			    data: JSON.stringify(vm.pageParams),
			    success: function(r){
			    	if(r.code === 0){
						vm.bsnMentorList = r.page.list;
					}else{
						alert(r.msg);
					}
				}
			});
		},
		gotoEdit: function(mentorId) {
			if (StringUtils.isNotEmpty(mentorId)) {
				location.href = "msMentorInfoEdit.html?id=" + mentorId;
			} else {
				location.href = "msMentorInfoEdit.html";
			}
		},
		preView: function(jianliurl) {
			if (StringUtils.isEmpty(jianliurl)) {
				return;
			}
			console.log("附件=" + jianliurl);
			var uploadUrl = getDownFileUrl(jianliurl);
			if (/iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase())) {
				openFileView(uploadUrl);
			} else {
				window.jsInvoke.openFileView(uploadUrl);
			}
		}
	},
	filters: {
		/*过滤并替换头像 */
		imgFilter: function (imgUrl, xingb) {
			if (StringUtils.isNotEmpty(imgUrl)) {
				return imgUrl;
			}
			if (xingb == "男") {
				return "images/man@2x.png";
			} else {
				return "images/woman@2x.png";
			}
		},
		attachFilter: function(jianliurl) {
			if (StringUtils.isNotEmpty(jianliurl)) {
				return "点击查看个人简历";
			} else {
				return "";
			}
		}
	}
});